﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace HLSL
{
    public class LightingMaterial:Material
    {
        public Vector3 AmbientColor { get; set; }//mau moi truong
        public Vector3 LightColor { get; set; }// mau anh sang
        public Vector3 LightDirection { get; set; }// huong anh sang
        public Vector3 SpecularColor { get; set; }// mau phan chieu 

        public LightingMaterial()
        {
            AmbientColor = new Vector3(.1f, .1f, .1f);
            LightColor = new Vector3(.9f, .9f, .9f);
            LightDirection = new Vector3(1, 1, 1);
            SpecularColor = new Vector3(1, 1, 1);
        }
        public override void SetEffectParamaters(Effect effect)
        {
            if (effect.Parameters["AmbientColor"] != null)
                effect.Parameters["AmbientColor"].SetValue(AmbientColor);
            if (effect.Parameters["LightColor"] != null)
                effect.Parameters["LightColor"].SetValue(LightColor);
            if (effect.Parameters["LightDirection"] != null)
                effect.Parameters["LightDirection"].SetValue(LightDirection);
            if (effect.Parameters["SpecularColor"] != null)
                effect.Parameters["SpecularColor"].SetValue(SpecularColor);
        }
    }
}
